<?php

{$AUTO_GENERATOR_INCLUDE_HEADER_TEMPLATE}

defined('_JEXEC') or die;

class {$AUTO_GENERATOR_COMPONENT|capitalize}View{$AUTO_GENERATOR_VIEW|capitalize} extends JViewLegacy {

    protected $item;

    public function display($tpl = null) {
        $this->item = $this->get('Item');
        
        if (!$this->item)
        {
            JFactory::getApplication()->redirect('index.php?option=com_{$AUTO_GENERATOR_COMPONENT|lower}&view={$AUTO_GENERATOR_VIEWS|lower}');
        }
        
        parent::display($tpl);
    }

}
